{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}

{{#unless view.outsideView}}
  <div {{bindAttr class="view.content.isActive::not-active-link"}}>
      {{statusIcon view.content.status}}
    <a href="#" {{action toggleExpanded target="view"}}>
        {{view.content.command_detail}}
    </a>
  </div>
{{/unless}}
{{#if view.isExpanded}}
  {{#if view.content.isContentLoaded}}
    <div class="task-details task-detail-info">
      <ul class="nav nav-pills" role="tablist">
        <li class="active"><a data-bs-toggle="tab" class="nav-link active" id="output-pill-tab" data-bs-toggle="pill" data-bs-target="#output-pill" {{bindAttr href="view.logTabIdLink"}}>{{t common.stdout}}</a></li>
        <li class="nav-item" {{action "setErrorActive" target="view"}}><a {{bindAttr href="view.errorTabIdLInk"}} class="nav-link" id="error-pill-tab" data-bs-toggle="pill" data-bs-target="#error-pill">{{t common.stderr}}</a></li>
      </ul>
      <div class="tab-content">
        <div class="tab-pane show active" id="output-pill" {{bindAttr id="view.logTabId"}}>
          <p>{{view.content.host_name}}</p>
          <div class="row">
            <p class="pull-left col-sm-6">{{view.content.output_log}}</p>
            <div class="manage-controls pull-right col-sm-6">
              <a {{translateAttr title="common.openNewWindow"}} {{action openOutLog target="view"}} class="task-detail-open-dialog pull-right">
                <i class="icon-external-link"></i> {{t common.open}}
              </a>
              <a {{translateAttr title="common.fullLogPopup.clickToCopy"}} {{action copyOutLog view.content target="view"}} class="task-detail-copy pull-right">
                <i class="glyphicon glyphicon-copy"></i> {{t common.copy}}
              </a>
            </div>
          </div>
          <pre {{bindAttr class="view.outputLogOpened:hidden :stdout"}}>{{view.content.stdout}}</pre>
          {{view Ember.TextArea valueBinding="view.content.stdout" classBinding="view.outputLogOpened::hidden" readonly="readonly"}}
        </div>
        <div class="tab-pane" {{bindAttr id="view.errorTabId"}}>
          <p>{{view.content.host_name}}</p>
          <div class="row">
            <p class="pull-left col-sm-6">{{view.content.error_log}}</p>
            <div class="manage-controls pull-right">
              <a {{translateAttr title="common.openNewWindow"}} {{action openErrorLog target="view"}} class="task-detail-open-dialog pull-right">
                <i class="icon-external-link"></i> {{t common.open}}
              </a>
              <a {{translateAttr title="common.fullLogPopup.clickToCopy"}} {{action copyErrLog view.content target="view"}} class="task-detail-copy pull-right">
                <i class="glyphicon glyphicon-copy"></i> {{t common.copy}}
              </a>
            </div>
          </div>
          <pre {{bindAttr class="view.errorLogOpened:hidden :stderr"}}>{{view.content.stderr}}</pre>
          {{view Ember.TextArea valueBinding="view.content.stderr" classBinding="view.errorLogOpened::hidden" readonly="readonly"}}
        </div>
      </div>
    </div>
  {{else}}
    {{view App.SpinnerView}}
  {{/if}}
{{/if}}
